#ifndef APP_H
#define APP_H


#include "main_inc.h"
#include "clog.h"
#include "SDL.h"
#include "SDL_ttf.h"
#include "timer.h"
#include "object.h"
#include "scene.h"
#include "resman.h"

#define MD_MENU     0x01
#define MD_GAME     0x02

#define BGR_R       0x45
#define BGR_G       0x45
#define BGR_B       0x45


class App
{
    public:
        App();
        virtual ~App();

        i32 RunThisShit();
        i32 CleanUp();

    protected:

        i32 InitializeVideo ( u32 w, u32 h, u32 bpp);
        i32 DoEvents();
        i32 LoadSprite(string filename, u32 sprite_ID);

        i32 LoadLiveObject(string filename, u32 sprite_ID, u32 frames);
        i32 LoadAnim(string filename, u32 sprite_ID, u32 frames);
        i32 Render();
        i32 DrawScene();
        i32 DrawMainMenu();
        i32 DrawNextMenuItem(string txt);

        i32 KeyPressed(SDL_Event &event);
        i32 KeyInMenu(SDL_Event &event);
        i32 KeyInGame();
    protected:

        u32 _frames;
        i32 _menu_option;
        u32 _mode;
        i32 _curr_menu_item;
        u32 _MENU_SIZE;

        TTF_Font *cour_big;
        TTF_Font *cour_med;
        TTF_Font *cour_sml;

        SDL_Surface *_screen;
        vector<Sprite> _sprites;

        Scene *_my_scene;

        i32 mousex, mousey;

    private:
        Timer t_timer;
        i32 test_angle;
        void test()
        {
            test_angle ++;
            if (test_angle >= ANGLES)
                test_angle = 0;
        }
};

#endif // APP_H
